/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:46 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class TainguyenEntity
    {
        public TainguyenEntity()
        {
			m_pk_itainguyenid=0;
			m_stentainguyen="";
			m_stentep="";
			m_dngaytao=DateTime.Now;
			m_fk_idanhmuctainguyenid=0;
			m_fk_inguoitaoid=0;
			m_fk_inguoicapnhatid=0;
			m_dngaycapnhat=DateTime.Now;
        }
		private Int64 m_pk_itainguyenid;
		public Int64 PK_iTainguyenID
		{
			get { return m_pk_itainguyenid ; }
			set { m_pk_itainguyenid = value; }
		}
		private String m_stentainguyen;
		public String sTentainguyen
		{
			get { return m_stentainguyen ; }
			set { m_stentainguyen = value; }
		}
		private String m_stentep;
		public String sTentep
		{
			get { return m_stentep ; }
			set { m_stentep = value; }
		}
		private DateTime m_dngaytao;
		public DateTime dNgaytao
		{
			get { return m_dngaytao ; }
			set { m_dngaytao = value; }
		}
		private Int16 m_fk_idanhmuctainguyenid;
		public Int16 FK_iDanhmuctainguyenID
		{
			get { return m_fk_idanhmuctainguyenid ; }
			set { m_fk_idanhmuctainguyenid = value; }
		}
		private Int64 m_fk_inguoitaoid;
		public Int64 FK_iNguoitaoID
		{
			get { return m_fk_inguoitaoid ; }
			set { m_fk_inguoitaoid = value; }
		}
		private Int64 m_fk_inguoicapnhatid;
		public Int64 FK_iNguoicapnhatID
		{
			get { return m_fk_inguoicapnhatid ; }
			set { m_fk_inguoicapnhatid = value; }
		}
		private DateTime m_dngaycapnhat;
		public DateTime dNgaycapnhat
		{
			get { return m_dngaycapnhat ; }
			set { m_dngaycapnhat = value; }
		}

        #region Comparison
        public static List<TainguyenEntity> Sort(List<TainguyenEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(TainguyenEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<TainguyenEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<TainguyenEntity> COMPARISON_PK_iTainguyenID
		{
			get
			{
				return delegate(TainguyenEntity entity,TainguyenEntity other)
				{
					return entity.PK_iTainguyenID.CompareTo(other.PK_iTainguyenID);
				};
			}
		}
		public static Comparison<TainguyenEntity> COMPARISON_sTentainguyen
		{
			get
			{
				return delegate(TainguyenEntity entity,TainguyenEntity other)
				{
					return entity.sTentainguyen.CompareTo(other.sTentainguyen);
				};
			}
		}
		public static Comparison<TainguyenEntity> COMPARISON_sTentep
		{
			get
			{
				return delegate(TainguyenEntity entity,TainguyenEntity other)
				{
					return entity.sTentep.CompareTo(other.sTentep);
				};
			}
		}
		public static Comparison<TainguyenEntity> COMPARISON_dNgaytao
		{
			get
			{
				return delegate(TainguyenEntity entity,TainguyenEntity other)
				{
					return entity.dNgaytao.CompareTo(other.dNgaytao);
				};
			}
		}
		public static Comparison<TainguyenEntity> COMPARISON_FK_iDanhmuctainguyenID
		{
			get
			{
				return delegate(TainguyenEntity entity,TainguyenEntity other)
				{
					return entity.FK_iDanhmuctainguyenID.CompareTo(other.FK_iDanhmuctainguyenID);
				};
			}
		}
		public static Comparison<TainguyenEntity> COMPARISON_FK_iNguoitaoID
		{
			get
			{
				return delegate(TainguyenEntity entity,TainguyenEntity other)
				{
					return entity.FK_iNguoitaoID.CompareTo(other.FK_iNguoitaoID);
				};
			}
		}
		public static Comparison<TainguyenEntity> COMPARISON_FK_iNguoicapnhatID
		{
			get
			{
				return delegate(TainguyenEntity entity,TainguyenEntity other)
				{
					return entity.FK_iNguoicapnhatID.CompareTo(other.FK_iNguoicapnhatID);
				};
			}
		}
		public static Comparison<TainguyenEntity> COMPARISON_dNgaycapnhat
		{
			get
			{
				return delegate(TainguyenEntity entity,TainguyenEntity other)
				{
					return entity.dNgaycapnhat.CompareTo(other.dNgaycapnhat);
				};
			}
		}
        #endregion
    }
}
